<%-- 
    Document   : listEmployees
    Created on : Dec 18, 2009, 8:44:36 AM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>List employees</title>
    </head>
    <body>
        <table border="1">
            <tr><th colspan="7">Employees list</th></tr>
            <tr><th>#</th><th>Username</th><th>Fullname</th><th>Date of birth</th></tr>
            <c:forEach var="employee" items="${employees}" varStatus="counter">
                <tr><td>${counter.count}</td>
                    <td>${employee.username}</td>
                    <td>${employee.fullname}</td>
                    <td><fmt:formatDate value="${employee.dateOfBirth}" pattern="MMM d, yyyy"/></td>
                    <td><form method="post"><input type="hidden" name="username" value="${employee.username}"/>
                            <input type="submit" name="delete" value="Delete"/>
                        </form></td>
                    <td><a href="<%=request.getContextPath()%>/admin/editEmployee?u=${employee.username}">Edit</a></td><td><a href="<%=request.getContextPath()%>/admin/assignRole?u=${employee.username}">Assign roles</a></td></tr>
                </c:forEach>
            <tr><td colspan="7"><a href="<%=request.getContextPath()%>/admin/editEmployee">Add new account</a></td></tr>
        </table>
    </body>
</html>